package com.simons.common.exception;

import java.io.IOException;
import java.util.Properties;

import com.simons.common.utils.file.txt.PropUtil;

import lombok.extern.log4j.Log4j2;

@Log4j2
public class CommonErrorType extends ErrorType{
	private static Properties properties;
	
	static{
		try {
			properties = PropUtil.getProperties("/error/error-common.properties", CommonErrorType.class);
		} catch (IOException e) {
			log.error("",e);
		}
	}
	
	public static final CommonErrorType COMMON_ERROR = new CommonErrorType("10001");
	
	public static final CommonErrorType COMMON_DATA_NULL = new CommonErrorType("00006");
	
	public static final CommonErrorType COMMON_DATA_EXIT = new CommonErrorType("00007");
	
	public static final CommonErrorType COMMON_REFLECT_RESET_ERROR = new CommonErrorType("00008");
	
	public static final CommonErrorType COMMON_REFLECT_INSTANCE_ERROR = new CommonErrorType("00009");
	
	public static final CommonErrorType COMMON_REFLECT_CONSTRUCTOR_ERROR = new CommonErrorType("00010");
	
	public static final CommonErrorType COMMON_BEAN_XML_ERROR = new CommonErrorType("00011");
	public static final CommonErrorType COMMON_XML_BEAN_ERROR = new CommonErrorType("00012");
	
	/**
	 * 登陆失败异常
	 */
	public static final CommonErrorType LOGION_FAIL = new CommonErrorType("00113");
	
	private CommonErrorType(String value) {
		super(value);
        this.value = value;
    }

	@Override
	public String getText() {
		return properties.getProperty(value);
	}

}
